class Solution:
    def findNthDigit(self, n: int) -> int:
        i = 1
        while n > 10 ** (i - 1) * 9 * i:
            n -= 10 ** (i - 1) * 9 * i
            i += 1
        return int(str(10 ** (i - 1) + (n - 1) // i)[n % i - 1])


a = Solution()
print(a.findNthDigit(3))
print(a.findNthDigit(11))
print(a.findNthDigit(10))
